package com.application.chiettinhdienluc.utils;

import com.application.chiettinhdienluc.app.MainApplication;

import android.content.Context;
import android.provider.Settings.Secure;
import android.telephony.TelephonyManager;

public class DeviceState {
	
	public static String getDeviceId()
	{
		Context context = MainApplication.getAppContext();
		String identifier = null;
		TelephonyManager tm = (TelephonyManager)context.getSystemService(Context.TELEPHONY_SERVICE);
		if (tm != null)
	      identifier = tm.getDeviceId();
		if (identifier == null || identifier .length() == 0)
	      identifier = Secure.getString( context.getContentResolver(),Secure.ANDROID_ID);
		
		return identifier;		
	}	

}
